package com.java.huxb.web.controller;

import com.java.huxb.web.Student;
import com.java.huxb.web.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author huxb
 * @date 2020/4/10 0010 上午 11:01
 */
@RestController
@RequestMapping("/index")
public class IndexController {

    @Autowired
    private IndexService indexService;

    @RequestMapping("/index")
    public String index() {
        indexService.testIndex();
        return "hello world";
    }

    @RequestMapping("/valid")
    public String valid( @Validated Student student) {
        return "111";
    }
}
